package org.lboot.idmo.module.user.role;

import org.lboot.idmo.module.role.SysRole;
import org.lboot.idmo.module.user.SysUser;
import org.lboot.jpa.service.BaseService;
import org.lboot.jpa.service.UniService;
import org.lboot.jpa.service.UnwrapService;

import java.util.List;
import java.util.Optional;

public interface SysUserRoleService extends UniService<SysUserRole,Long>{
    List<SysUser> getUsers(Long roleId);

    List<SysRole> getRoles(Long userId);

    List<SysUserRole> getByRoleId(Long roleId);

    Boolean isExistMap(Long userId, Long roleId);

    Optional<SysUserRole> getMap(Long userId,Long roleId);

    void deleteByUserId(Long userId);

    void deleteByRoleId(Long roleId);

    void deleteByUserIds(List<Long> userIds);

    void deleteByRoleIds(List<Long> roleIds);

    boolean batchSave(Iterable<SysUserRole> maps);


}
